package org.wzh.spring.di.demo8;

import org.springframework.stereotype.Component;
import org.wzh.spring.di.demo1.CompactDisc;
import org.wzh.spring.di.demo4.MediaPlayer;

@Component
public class CDPlayer implements MediaPlayer {
	private CompactDisc cd;
	
	public CDPlayer(CompactDisc cd) {
		this.cd = cd;
	}

	@Override
	public void play() {
		cd.play();
	}

	public CompactDisc getCd() {
		return cd;
	}

	public void setCd(CompactDisc cd) {
		this.cd = cd;
	}

}
